<?php
/**
 * @var $model \workin\modules\others\models\ExcelUploadForm
 * @var $this \yii\web\View
 */
$log_path = \common\models\credit_app\Member::getLogPath();
if (is_dir($log_path)){
    $log_files = scandir($log_path);
    foreach ($log_files as $k => $v){
        if ($v=='.')unset($log_files[$k]);
        if ($v=='..')unset($log_files[$k]);
    }
}
$this->title = '导入member';
?>
<div class="others-default-import-site-excel">
    <div class="row">
        <div class="col-lg-12">
            <h4>上传</h4>
            <?php $form = \kartik\form\ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]) ?>
            <?=$form->field($model, 'file')->fileInput() ?>
            <?= \kartik\helpers\Html::submitButton('上传', ['class' => 'btn btn-primary']) ?>
            <?php \kartik\form\ActiveForm::end() ?>
        </div>
        <?php if (isset($log_files)): ?>
        <div class="col-lg-12">
            <h4>日志</h4>
            <?php foreach($log_files as $k => $v): ?>
                <?=\yii\helpers\Html::a($v, ['check-member-import-log', 'file'=>$v], ['class'=>'btn btn-info']) ?>
            <?php endforeach; ?>
        </div>
        <?php endif; ?>
    </div>
</div>
